using System;

namespace Catastrophe.Common.Extensions
{
	public static class Extensions
	{
		public static void CheckNull(this object obj, string parameterName)
		{
			if (obj == null)
			{
				throw new ArgumentNullException(parameterName);
			}
		}

		public static bool IsEmpty(this string value)
		{
			return string.IsNullOrWhiteSpace(value);
		}

		public static bool IsEmpty(this Guid? value)
		{
			if (!value.HasValue)
			{
				return true;
			}
			return value.Value.IsEmpty();
		}

		public static bool IsEmpty(this Guid value)
		{
			if (value == Guid.Empty)
			{
				return true;
			}
			return false;
		}
	}
}
